/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package redis.pipe;

/**
 *
 * @author dell
 */
import entity.support.KeyValue;
import java.util.List;
import java.util.LinkedList;
public abstract class Pipe 
{
//columns_______________________________________________________________________
protected List<KeyValue<String,Integer>> pipes;
protected String dburl;//the url of database
protected String redishost;//the url of redis
protected int redisport;//the port
protected String redispassword;//the password of redis
protected boolean initialized=false;
//functions_____________________________________________________________________
     //getter___________________________________________________________________
public List<KeyValue<String, Integer>> getPipes() 
{
     return pipes;
}
public String getDburl() 
{
     return dburl;
}
public String getRedishost() 
{
     return redishost;
}
public int getRedisport()
{
     return redisport;
}
public String getRedispassword() 
{
     return redispassword;
}
public boolean getInitialized() 
{
     return initialized;
}
     //setter___________________________________________________________________
public void setPipes(List<KeyValue<String,Integer>> pipes) 
{
     this.pipes = pipes;
}
public void setDburl(String dburl) 
{
     this.dburl = dburl;
}
public void setRedishost(String redishost) 
{
     this.redishost = redishost;
}
public void setRedisport(int redisport)
{
     this.redisport=redisport;
}
public void setRedispassword(String redispassword) 
{
     this.redispassword = redispassword;
}
public void setInitialized(boolean initialized) 
{
     this.initialized = initialized;
}
     //operator_________________________________________________________________
/**
 * init the Pipe throw an xml file,url is the path of the configration file,
 * if intitialization is completed,column initialized will be true
 * @param url
 * @return 
 */
protected abstract void init(String url);
protected abstract boolean pipe();
protected abstract boolean destroy();
     //to String________________________________________________________________
@Override
public String toString()
{
     return pipes+"\t"+redishost+"\t"+redispassword+"\t"+dburl;
}
}
